home *** CD-ROM | disk | FTP | other *** search
- Path: brazerko.com!Pennywise
- From: Pennywise@brazerko.com (Pennywise)
- Newsgroups: comp.lang.c++
- Subject: Graphics formats
- Message-ID: <56a8a984@brazerko.com>
- Date: Sat, 27 Jan 96 11:27:00 -0500
- Organization: Brazerko Communications
-
- I'm working on a graphics program. I need to be able to save the image on
- the screen to a graphics file. Can anyone help me by supplying either
- some code, or the format to any common graphic file type ( PCX, GIF, BMP,
- &c )? Here's the code I'm using to manipulate the color palette:
-
- typedef struct RGB_color_typ
- {
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- } RGB_color, *RGB_color_ptr;
- #define PALETTE_MASK 0x3c6
- #define PALETTE_REGISTER_RD 0x3c7
- #define PALETTE_REGISTER_WR 0x3c8
- #define PALETTE_DATA 0x3c9
- void SetPalette(int index, RGB_color_ptr color)
- {
- outp(PALETTE_MASK,0xff);
- outp(PALETTE_REGISTER_WR, index);
- outp(PALETTE_DATA,color->red);
- outp(PALETTE_DATA,color->green);
- outp(PALETTE_DATA,color->blue);
- }
- void GetPalette(int index, RGB_color_ptr color)
- {
- outp(PALETTE_MASK,0xff);
- outp(PALETTE_REGISTER_RD, index);
- color->red = inp(PALETTE_DATA);
- color->green = inp(PALETTE_DATA);
- color->blue = inp(PALETTE_DATA);
- }
-
- I'm using int 10 to set the graphics mode to 0x13, which is 320x200 with
- 256 colors. I'm working exclusively in that mode, for now.
-
-
-
- --
- .-----------------------------------------------------------------------.
- | The gateway is Brazerko Communications'; the opinions are the user's. |
- | sales@brazerko.com info@brazerko.com ('bot) +1 860 886 1441 (BBS) |
- `-----------------------------------------------------------------------'
-